//
//  SampleView.m
//  OperationPro
//
//  Created by yaxue wang on 2016/12/19.
//  Copyright © 2016年 展鸿科技. All rights reserved.
//

#import "SampleView.h"

@interface SampleView ()
@property(nonatomic,strong)UITextField *nameText;
@property(nonatomic,strong)UITextField *standardsText;
@property(nonatomic,strong)UITextField *numText;
@property(nonatomic,strong)UITextField *totalText;
@property(nonatomic,strong)UITextField *useText;
@property(nonatomic,strong)UITextField *remarkText;
@end
@implementation SampleView

-(instancetype)initWithFrame:(CGRect)frame withTilte:(NSString*)title {
    
    self = [super initWithFrame:frame];
    if (self){
        
        UIView *headView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, WindowWidth, 40)];
        headView.backgroundColor=[UIColor grayColor];
        [self addSubview: headView];
        UILabel *titleLab=[[UILabel alloc]initWithFrame:CGRectMake(15, 0, WindowWidth-30, 40)];
        titleLab.text=title;
        titleLab.font=F(14);
        titleLab.textColor=MainColor;
        [headView addSubview:titleLab];
        NSArray *ar=[NSArray arrayWithObjects:@"物品名称",@"规格",@"数量",@"总价(元)",@"用途",@"备注", nil];
//        NSArray *placeAr=[NSArray arrayWithObjects:@"请输入（必填）",@"请输入",@"请输入（必填）",@"请输入（必填）",@"请输入（必填）",@"请输入", nil];
        for (int i=0; i<ar.count; i++) {
            UILabel *Lab=[[UILabel alloc]initWithFrame:CGRectMake(15, 40+(44*i), 70, 44)];
            Lab.text=title;
            Lab.font=F(14);
            Lab.textColor=MainColor;
            Lab.text=[ar objectAtIndex:i];
            [self addSubview:Lab];
        }
         _nameText=[[UITextField alloc]initWithFrame:CGRectMake(85+10, 40, WindowWidth-70-40, 44)];
        _nameText.placeholder=@"请输入（必填）";
        _nameText.font=F(14);
        _nameText.textColor=MainColor;
        [self addSubview:_nameText];
        
        _standardsText=[[UITextField alloc]initWithFrame:CGRectMake(85+10, 40+44, WindowWidth-70-40, 44)];
        _standardsText.placeholder=@"请输入";
        _standardsText.font=F(14);
        _standardsText.textColor=MainColor;
        [self addSubview:_standardsText];
        
        _numText=[[UITextField alloc]initWithFrame:CGRectMake(85+10, 40+44*2, WindowWidth-70-40, 44)];
        _numText.placeholder=@"请输入（必填）";
        _numText.font=F(14);
        _numText.textColor=MainColor;
        [self addSubview:_numText];
        
        _totalText=[[UITextField alloc]initWithFrame:CGRectMake(85+10, 40+44*3, WindowWidth-70-40, 44)];
        _totalText.placeholder=@"请输入（必填）";
        _totalText.font=F(14);
        _totalText.textColor=MainColor;
        [self addSubview:_totalText];
        
        _useText=[[UITextField alloc]initWithFrame:CGRectMake(85+10, 40+44*4, WindowWidth-70-40, 44)];
        _useText.placeholder=@"请输入（必填）";
        _useText.font=F(14);
        _useText.textColor=MainColor;
        [self addSubview:_useText];
        
        _remarkText=[[UITextField alloc]initWithFrame:CGRectMake(85+10, 40+44*5, WindowWidth-70-40, 44)];
        _remarkText.placeholder=@"请输入";
        _remarkText.font=F(14);
        _remarkText.textColor=MainColor;
        [self addSubview:_remarkText];
        
        
    }
    return self;
}
@end
